<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
  <meta name="renderer" content="webkit" />
  <!-- <title>丘比特媒体报道</title> -->
  <meta id="i18n_pagename" content="index-common" />

  <title class="i18n" name="common-title"></title>

  <link rel="stylesheet" href="css/bootstrapv3.css" />
  <link rel="stylesheet" href="css/base.css" />
  <link rel="stylesheet" href="css/qunit-1.11.0.css" />
  <!-- <link rel="stylesheet" href="css/bootstrap.min.css" /> -->
  <link rel="stylesheet" href="css/latestNotice.css" />
  <!-- jQuery (Bootstrap 的所有 JavaScript 插件都依赖 jQuery，所以必须放在前边) -->
  <script src="js/jquery-1.12.4.min.js"></script>
  <!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
  <!-- <script src="js/bootstrap.min.js"></script> -->
  <script src="js/bootstrapv3.js"></script>
  <script src="js/bootstrap-paginator.min.js"></script>
  <script src="js/jquery.cookie.js"></script>
  <!-- 加载语言包文件 -->
  <script src="js/jquery.i18n.properties.js"></script>
  <script src="js/language.js"></script>
  <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.js"></script> -->
  <!--[if lt IE 9]>
      <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
      <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
    <![endif]-->
</head>

<body>
  <div class="notice">
    <nav class="navbar cupid_head">
      <div class="head_bar">
        <div class="main_center">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" aria-expanded="false">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <div class="navbar-right langu">
              <a id="language-content" class="language"></a>
              <ul class="language_list" style="display: none;">
                <li id="btnZh" style="cursor:pointer" class="language_list_one">
                  简体中文
                </li>
                <li id="btnEn" style="cursor:pointer" class="language_list_one">
                  English
                </li>
              </ul>
            </div>
            <a class="navbar-brand" href="index.html"><img src="images/logo.png" /></a>
          </div>

          <div class="collapse navbar-collapse pc_head">
            <div class="row">
              <div class="nav navbar-nav logo">
                <a href="index.html"><img src="images/logo.png" /></a>
              </div>
              <div class="navbar-right langu">
                <a id="language-content" class="language"></a>
                <ul class="language_list" style="display: none;">
                  <li id="btnZh" style="cursor:pointer" class="language_list_one">
                    简体中文
                  </li>
                  <li id="btnEn" style="cursor:pointer" class="language_list_one">
                    English
                  </li>
                </ul>
              </div>
              <ul class="nav navbar-nav navbar-right nav_list hidden-sm">
                <li>
                  <a href="index.html" class="i18n" name="common-index"></a>
                </li>
                <li>
                  <a href="application.html" class="i18n" name="common-application"></a>
                </li>
                <li>
                  <a href="dapp.html" class="i18n" name="common-dapp"></a>
                </li>
                <li>
                  <a href="love_machine.html" class="i18n" name="common-love-machine"></a>
                </li>
                <li>
                  <a href="technology.html" class="i18n" name="common-technology"></a>
                </li>
                <li>
                  <a href="economies.html" class="i18n" name="common-economies"></a>
                </li>
                <li>
                  <a href="community.html" class="i18n" name="common-community"></a>
                </li>
                <li>
                  <a href="fund.html" class="i18n" name="common-fund"></a>
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>

      <div class="nav_slider_mask" style="display: none;">
        <ul class="nav_slider_list">
          <li class="nav_slider_one">
            <a href="index.html" class="i18n" name="common-index"></a>
          </li>
          <li class="nav_slider_one">
            <a href="application.html" class="i18n" name="common-application"></a>
          </li>
          <li class="nav_slider_one">
            <a href="dapp.html" class="i18n" name="common-dapp"></a>
          </li>
          <li class="nav_slider_one">
            <a href="love_machine.html" class="i18n" name="common-love-machine"></a>
          </li>
          <li class="nav_slider_one">
            <a href="technology.html" class="i18n" name="common-technology"></a>
          </li>
          <li class="nav_slider_one">
            <a href="economies.html" class="i18n" name="common-economies"></a>
          </li>
          <li class="nav_slider_one">
            <a href="community.html" class="i18n" name="common-community"></a>
          </li>
          <li class="nav_slider_one">
            <a href="fund.html" class="i18n" name="common-fund"></a>
          </li>
        </ul>
      </div>
    </nav>
    <!-- 头部 -->
    <div class="top_content">
      <div class="container">
        <div class="i18n top_text" name="home-section8-title">
          <!-- 媒体报道 -->
        </div>
      </div>
    </div>

    <div class="notice_main container">
      <ul id="ulHtml" class="notice_list">
        <!-- 动态填充 -->
      </ul>
      <div id="last-paginator" class="col-lg-12" align="center">
        <ul id="page"></ul>
      </div>
    </div>

    <!-- 底部 -->
    <footer>
      <div class="container clearfix">
        <div class="footer_top  col-xs-12 col-sm-12 col-md-6 col-lg-6">
          <div class="footer_list  col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <div class="i18n footer_tit" name="common-footer-label1">
              <!-- 社群治理 -->
            </div>
            <a href="proposals.html" class="i18n list_tit" name="common-footer-label2">
              <!-- 丘比特改进提案 -->
            </a>
            <a href="latest_notice.html" class="i18n list_tit" name="common-footer-label3">
              <!-- 最新公告 -->
            </a>
          </div>
          <div class="footer_list  col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <div class="i18n footer_tit" name="common-footer-label4">
              <!-- 关于 -->
            </div>
            <a href="team_members.html" class="i18n list_tit" name="common-footer-label5">
              <!-- 团队 -->
            </a>
            <a href="contactus.html" class="i18n list_tit" name="common-footer-label6">
              <!-- 联系我们 -->
            </a>
          </div>
          <div class="footer_list  col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <div class="i18n footer_tit" name="common-footer-label7">
              <!-- 服务条款 -->
            </div>
            <a href="copyright.html" class="i18n list_tit" name="common-footer-label8">
              <!-- 版权声明 -->
            </a>
            <a href="disclaimer.html" class="i18n list_tit" name="common-footer-label9">
              <!-- 免责声明 -->
            </a>
          </div>
        </div>
        <div class="footer_center  col-xs-12 col-sm-12 col-md-6 col-lg-6">
          <div class="i18n footer_center_tit" name="common-footer-label10">
            <!-- 关注我们 -->
          </div>
          <div class="footer_center_main clearfix">
            <div id="Telegram" class="footer_center_one fl">
              <div class="footer_center_icon">
                <img src="images/network_1.png" alt="" />
              </div>
              <div class="footer_center_text">Telegram</div>
            </div>
            <div id="Facebook" class="footer_center_one fl">
              <div class="footer_center_icon">
                <img src="images/network_2.png" alt="" />
              </div>
              <div class="footer_center_text">Facebook</div>
            </div>
            <div id="Twitter" class="footer_center_one fl">
              <div class="footer_center_icon">
                <img src="images/network_3.png" alt="" />
              </div>
              <div class="footer_center_text">Twitter</div>
            </div>
            <div id="Weibo" class="footer_center_one fl">
              <div class="footer_center_icon">
                <img src="images/network_4.png" alt="" />
              </div>
              <div class="footer_center_text">Weibo</div>
            </div>
            <!-- <div id="Wechat" class="footer_center_one fl">
                <div class="footer_center_icon">
                  <img src="images/network_5.png" alt="" />
                </div>
                <div class="footer_center_text">Wechat</div>
              </div> -->
          </div>
        </div>
        <div class="i18n footer_bootom" name="common-footer-bootom">
          <!-- 版权所有@1692018-2020 cbit.love保留所有权利
                  联系我们：global@cbit.love -->
        </div>
      </div>
    </footer>
  </div>

  <script type="text/javascript">
    function to_detail(postUrl, id) {
      if (postUrl.indexOf('news_detail.html?id=') != -1 || checkRate(postUrl)) {
        window.location.href = 'news_detail.html?id=' + id;
      } else {
        window.location.href = postUrl;
      }
    }

    function checkRate(input) {
      var re = /^[0-9]+.?[0-9]*/; //判断字符串是否为数字//判断正整数/[1−9]+[0−9]∗]∗/;//判断字符串是否为数字//判断正整数/[1−9]+[0−9]∗]∗/
      if (!re.test(input)) {
        return false;
      }
      return true;
    }

    function getHtml(list) {
      let html = '';
      $.each(list, function (i, item) {
        var postUrl = item.postUrl;
        console.log(postUrl)
        // console.log(JSON.stringify(item))
        postUrl = postUrl.replace(/[\r\n]/g, "");
        html +=
          "<li class=\"notice_one clearfix\" style=\"cursor:pointer\"  onclick=\"to_detail('" +
          postUrl +
          "'," +
          item.postId +
          ")\">";
        html +=
          '<div class="notice_one_img col-sm-12 col-xs-12 col-md-4 col-lg-4">';
        html += ' <img src="' + item.postThumbnail + '" />';
        html +=
          '</div> <div class="notice_one_detail col-sm-12 col-xs-12 col-md-8 col-lg-8"> <div class="notice_title">';
        // if (true) {
        //   html += item.postTitle + '';
        // }
        if (i18nLanguage == 'zh-CN') {
          html += item.postTitle + '';
        } else {
          html += item.postUsTitle;
        }
        html += '</div> <div class="notice_subheading">';
        html += item.postDate.split(' ')[0];
        html += '</div><div class="notice_text">';
        if (i18nLanguage == 'zh-CN') {
          html += item.postSummary + '';
        } else {
          html += item.postUsSummary;
        }
        // html += item.postSummary;
        html += '</div></div></li >';
      });
      $('#ulHtml').html(html);
    }

    function paging(page) {
      $.ajax({
        type: 'GET',
        url: 'api/archives/information/page/' + page,
        headers: {
          token: '9f47733dfb9075387f8705dbc7e93199'
        },
        dataType: 'json',
        success: function (msg) {
          console.log(msg);
          let totalPages = msg.result.totalPages;
          if (msg.result) {
            getHtml(msg.result.content);
          }
        }
      });
    }
    $.ajax({
      type: 'GET',
      url: 'api/archives/information/page/1',
      headers: {
        token: '9f47733dfb9075387f8705dbc7e93199'
      },
      dataType: 'json',
      success: function (msg) {
        console.log(msg);
        let totalPages = msg.result.totalPages;
        if (msg.result) {
          getHtml(msg.result.content);
        }
        var options = {
          currentPage: 1,
          totalPages: totalPages,
          numberOfPages: 5, //设置控件显示的页码数
          // size: 'small',
          // alignment: 'center',
          bootstrapMajorVersion: 3,
          // currentPage: 3,
          // totalPages: 11,
          // shouldShowPage: function (type, page, current) {
          //   switch (type) {
          //     case "first":
          //     case "last":
          //       return false;
          //     default:
          //       return true;
          //   }
          // },
          // itemTexts: function(type, page, current) {
          //   //文字翻译可有可无
          //   switch (type) {
          //     case 'first':
          //       return '首页';
          //     case 'prev':
          //       return '上一页';
          //     case 'next':
          //       return '下一页';
          //     case 'last':
          //       return '尾页';
          //     case 'page':
          //       return page;
          //   }
          // },
          onPageClicked: function (event, originalEvent, type, page) {
            //页面跳转后调用ajax函数进行页面信息展示以及DOM操作
            paging(page);
          }
        };

        $('#page').bootstrapPaginator(options);
      }
    });

    // $('#page').bootstrapPaginator('showFirst');

    $('.navbar-toggle').click(function () {
      $('.nav_slider_mask').toggle();
    });
  </script>
</body>

</html>